﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
using Generico.Coneccion;
using System.Data;

namespace RosarioFinanzas
{
    public partial class TablasMervaros : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        [WebMethod]
        public static string IniciarPanel(string str)
        {
            var cn = new ClsConeccion();
            cn.Abrir();
            string sql = "Select varMoneda, '$' + Replace (Cast(Cast(PromedioRFCompra as Numeric(9,3)) as varchar),'.',',')  Compra, '$' + Replace (Cast(Cast(PromedioRFVenta as Numeric(9,3)) as varchar),'.',',')  Venta From Promedios P ";
            sql += "inner Join  (Select Moneda, Max(Fecha) fec From Promedios ";
            sql += "group by Moneda) P1 on P1.Moneda = P.Moneda and P1.Fec = P.Fecha ";
            sql += "Inner Join Monedas M on P.Moneda = M.idMoneda order by P.Moneda ";
            var sqldr2 = cn.EjecutarSqlDataReader(sql);
            var dt = new DataTable();
            dt.Load(sqldr2);
            cn.Cerrar();


            string html = "";
            html += "<table style=\"width:100%;	background-color: White;border-color:Black;	border-style:solid;	border-width:thin;border-collapse:collapse;\">";
            html += "<tr style=\"background-color:#E46D0A;color:White;font-weight:bold;\">";
            html += "<td width=\"100%\" colspan=\"4\">MERVAROS</td>";
            html += "</tr>";

            html += "<tr>";
            html += "<td class=\"Moneda\" colspan=\"2\">" + "Caución 7 días" + "</td>";
            html += "<td Style=\"border-color:Black;border-bottom-style:solid;border-left-style:solid;border-width:thin;text-align:center;	padding:0;	font-family:@Arial Unicode MS;	font-size:12px;\">" + "9,00%" + "</td>";
            html += "</tr>";

            html += "<tr>";
            html += "<td class=\"Moneda\" colspan=\"2\">" + "Caución 14 días" + "</td>";
            html += "<td Style=\"border-color:Black;border-bottom-style:solid;border-left-style:solid;border-width:thin;text-align:center;	padding:0;	font-family:@Arial Unicode MS;	font-size:12px;\">" + "9,00%" + "</td>";
            html += "</tr>";

            html += "<tr>";
            html += "<td class=\"Moneda\" colspan=\"2\">" + "Caución 28 días" + "</td>";
            html += "<td Style=\"border-color:Black;border-bottom-style:solid;border-left-style:solid;border-width:thin;text-align:center;	padding:0;	font-family:@Arial Unicode MS;	font-size:12px;\">" + "9,00%" + "</td>";
            html += "</tr>";

            html += "<tr>";
            html += "<td class=\"Moneda\" colspan=\"2\">" + "Cheque avalado 30 días" + "</td>";
            html += "<td Style=\"border-color:Black;border-bottom-style:solid;border-left-style:solid;border-width:thin;text-align:center;	padding:0;	font-family:@Arial Unicode MS;	font-size:12px;\">" + "9,00%" + "</td>";
            html += "</tr>";

            html += "<tr>";
            html += "<td class=\"Moneda\" colspan=\"2\">" + "Cheque avalado 60 días" + "</td>";
            html += "<td Style=\"border-color:Black;border-bottom-style:solid;border-left-style:solid;border-width:thin;text-align:center;	padding:0;	font-family:@Arial Unicode MS;	font-size:12px;\">" + "9,00%" + "</td>";
            html += "</tr>";

            html += "<tr>";
            html += "<td class=\"Moneda\" colspan=\"2\">" + "Cheque avalado 90 días" + "</td>";
            html += "<td Style=\"border-color:Black;border-bottom-style:solid;border-left-style:solid;border-width:thin;text-align:center;	padding:0;	font-family:@Arial Unicode MS;	font-size:12px;\">" + "9,00%" + "</td>";
            html += "</tr>";

            html += "<tr>";
            html += "<td class=\"Moneda\" colspan=\"2\">" + "Cheque avalado 180 días" + "</td>";
            html += "<td Style=\"border-color:Black;border-bottom-style:solid;border-left-style:solid;border-width:thin;text-align:center;	padding:0;	font-family:@Arial Unicode MS;	font-size:12px;\">" + "9,00%" + "</td>";
            html += "</tr>";

            html += "<tr>";
            html += "<td class=\"Moneda\" colspan=\"2\">" + "Cheque warrant 140 días" + "</td>";
            html += "<td Style=\"border-color:Black;border-bottom-style:solid;border-left-style:solid;border-width:thin;text-align:center;	padding:0;	font-family:@Arial Unicode MS;	font-size:12px;\">" + "9,00%" + "</td>";
            html += "</tr>";
		
            html += "</table>";
            return html;
        }
    }
}